package java基础.operator;

import java.util.Scanner;

/**
 * @author IT_Jay
 * @date 2021/11/29 19:22
 */

public class Demo08 {
    public static void main(String[] args) {
        //三元运算符
        // x ? y : z
        //如果x==true,则结果为y，否则结果为z

        int score = 80;
        String type = score < 60 ? "不及格" : "及格";        //必要，常见，可精简代码
        //if
        System.out.println(type);

        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入成绩:");
        int inputScore = scanner.nextInt();
        String type1 = inputScore < 60 ? "不及格" : "及格";
        System.out.println(type1);

    }
}
